package com.rs.game.player.content.commands;

import com.rs.game.player.Player;
import com.rs.game.player.content.pet.Pets;
import com.rs.utils.Misc;
import com.rs.utils.Utils;

public class ExtremeDonator {
	/*
	 * Handles Extreme Donator Commands
	 */
	public static boolean processCommand(final Player player, String[] cmd, boolean console, boolean clientCommand) {
		if (clientCommand) {
			
		} else {
			switch (cmd[0]) {
			case "bank":
				if (!player.canSpawn() || (player.getAttackedByDelay() + 10000 > Utils.currentTimeMillis())) {
					player.getPackets().sendGameMessage("You can't open your bank here.");
					return true;
				} else {
					player.getBank().openBank();
				}
				return true;
				
			case "settrollname":
				String name1 = "";
				for (int i = 1; i < cmd.length; i++) {
					name1 += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
				}
				name1 = Misc.formatPlayerNameForDisplay(name1);
				if (name1.length() < 3 || name1.length() > 14) {
					player.getPackets()
					.sendGameMessage(
							"You can't use a name shorter than 3 or longer than 14 characters.");
					return true;
				}
				player.getPetManager().setTrollBabyName(name1);
				if (player.getPet() != null
						&& player.getPet().getId() == Pets.TROLL_BABY
						.getBabyNpcId()) {
					player.getPet().setName(name1);
				}
				return true;
			}
		}
		return false;
	}
}